import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// 按需引入elementui
import {Button, MessageBox } from 'element-ui';
Vue.component(Button.name, Button);
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
// 引入swiper下的样式
import "swiper/css/swiper.css"
Vue.config.productionTip = false
// 全局使用三级联动组件
import TypeNve from '@/components/TypeNve'
Vue.component(TypeNve.name,TypeNve)
import Pagination from '@/components/Pagination'
// 统一引入接口对象
import * as API from '@/api'
// 引入懒加载插件
import VueLazyload from 'vue-lazyload'
import loading from '@/assets/images/loading.gif'
Vue.use(VueLazyload,{
   loading
})
// 表单验证
import '@/plugins/validate'
Vue.component(Pagination.name,Pagination)
new Vue({
  router,
  // 注册仓库
  store,
  render: h => h(App),
  // 配置全局事件总线$bus
  beforeCreate(){
    Vue.prototype.$bus = this;
    Vue.prototype.$API = API
  }
}).$mount('#app')
